<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <input type="file" name="f1" id="file1">
    <input type="file" name="f1" id="file2">
    <input type="file" name="f1" id="file3">
    <input type="button" value="上传文件" id="btn1">
</body>
<script>
    let aFile=Array.from(document.getElementsByTagName('f1'));
    let oBtn=document.getElementById('btn1');

    oBtn.onclick=function(){
        let oAjax = new XMLHttpRequest();
        oAjax.open('POST','/upload',ture);
        let fromData=new fromData();
        afile.forEach(oFile=>{
            Array.from(oFile.files).forEach(file=>{
                fromData.append('f1',file)
            })
        })
        
        oAjax.send(fromData)
        oAjax.onreadystatechange=function(){
            if(oAjax.readyState==4){
                alert(oAjax.status);
            }
        }
    }
</script>
</html>